﻿@model ProjectThuCung.Models.SanPham

@{
    ViewBag.Title = "Thêm vật phẩm";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<div style="margin:30px">
    <h2>Thêm vật phẩm</h2>

    @using (Html.BeginForm()) {
        @Html.ValidationSummary(true)

        <fieldset>
            <legend>SanPham</legend>

            @Html.HiddenFor(model => model.ThongTinThemID)

            <div class="editor-label">
                @Html.LabelFor(model => model.TenSanPham)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.TenSanPham)
                @Html.ValidationMessageFor(model => model.TenSanPham)
            </div>
            
            <div class="editor-label">
                @Html.LabelFor(model => model.LoaiSanPhamID, "Loại sản phẩm")
            </div>
            <div class="editor-field">
                @Html.DropDownList("LoaiSanPhamID", String.Empty)
                @Html.ValidationMessageFor(model => model.LoaiSanPhamID)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.XuatXuID, "Xuất xứ")
            </div>
            <div class="editor-field">
                @Html.DropDownList("XuatXuID", String.Empty)
                @Html.ValidationMessageFor(model => model.XuatXuID)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.MoTa)
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(model => model.MoTa, new { @id = "ckeMoTa" })
                <script type="text/javascript">
                    CKEDITOR.replace("ckeMoTa");
                </script>
                @Html.ValidationMessageFor(model => model.MoTa)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.HinhAnh)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.HinhAnh)
                @Html.ValidationMessageFor(model => model.HinhAnh)
            </div>
            
            <div class="editor-label">
                @Html.LabelFor(model => model.Gia)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Gia)
                @Html.ValidationMessageFor(model => model.Gia)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.SoLuong)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.SoLuong)
                @Html.ValidationMessageFor(model => model.SoLuong)
            </div>

            <p>
                <input type="submit" value="Thêm vật phẩm" />
            </p>
        </fieldset>
    }

    <div>
        @Html.ActionLink("Về danh sách", "Index")
    </div>

    @section Scripts {
        @Scripts.Render("~/bundles/jqueryval")
    }
</div>